﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccessLayer;
using DataAccessLayer.DAL;
using Common;

namespace BestBuy.Account
{
    public partial class ActiveUser : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string code = Request.QueryString["Code"];
            User user = UserDAL.FindUserByActiveCode(code);

            if (user == null)
            {
                ActiveMessageMultiView.ActiveViewIndex = 0;
            }
            else if (user.Status != (int)UserStatus.Inactive)
            {
                ActiveMessageMultiView.ActiveViewIndex = 1;
            }
            else
            {
                UserDAL.ActiveUserByCode(code);
                ActiveMessageMultiView.ActiveViewIndex = 2;
            }
        }
    }
}